<!--{include header}-->

<!--http://shopping4vn.online.fr-->
<script type="text/javascript">
	var relays = new Array() ;
	<!--{loop $team_relays $id $relay}-->
	var r = new Array({$relay['id']}, "{$relay['czone']}", "{$relay['name']}", "{$relay['lat']}", "{$relay['lng']}");
	relays.push (r);
	<!--{/loop}-->
	var address = "{$login_user['address']}" ;
</script>


<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=ABQIAAAAVreqVmzqK6MXBRgsFMpU7xT87lOewn1i-7gQ83VqizmUMg5dDxShGpGpf0httvtWgXL5qGOJw-luTw" type="text/javascript"></script>
<script src="/static/js/ext/base.js" type="text/javascript"></script>
<script src="/static/js/ext/all.js" type="text/javascript"></script>
<script src="/static/js/ext/panel.js" type="text/javascript"></script>
<script src="/static/js/gmap.js" type="text/javascript"></script>

<div id="bdw" class="bdw">
<div id="bd" class="cf">
<div id="content">
    <form action="/team/buy.php?id={$team['id']}" method="post" class="validator">
	<input id="deal-per-number" value="{$team['per_number']}" type="hidden" />
    <div id="deal-buy" class="box">
        <div class="box-top"></div>
        <div class="box-content">
            <div class="head"><h2>Submit order<!--{if $team['farefree']>0}-->&nbsp;(<span class="currency">{$team['farefree']}</span>free of express fee)<!--{/if}--></h2></div>
            <div class="sect">
            <table class="order-table">
                <tr>
                    <th class="deal-buy-desc">deal name</th>
                    <th class="deal-buy-quantity">quantity</th>
                    <th class="deal-buy-multi"></th>
                    <th class="deal-buy-price">price</th>
                    <th class="deal-buy-equal"></th>
                    <th class="deal-buy-total">total</th>
                </tr>
                <tr>
                    <td class="deal-buy-desc">{$team['title']}</td>
                    <td class="deal-buy-quantity"><input type="text" class="input-text f-input" maxlength="4" name="quantity" value="{$order['quantity']}" ff="${abs(intval($team['farefree']))}" id="deal-buy-quantity-input" ${$team['per_number']==1?'readonly':''} /><br /><span style="font-size:12px;color:gray;"><!--{if $team['per_number']==0}-->at most 9999 pieces<!--{else}-->at most{$team['per_number']}pieces<!--{/if}--></span></td>
                    <td class="deal-buy-multi">x</td>
                    <td class="deal-buy-price"><span class="money">{$currency}</span><span id="deal-buy-price">{$team['team_price']}</span></td>
                    <td class="deal-buy-equal">=</td>
                    <td class="deal-buy-total"><span class="money">{$currency}</span><span id="deal-buy-total">{$order['quantity']*$team['team_price']}</span></td>
                </tr>
				<!--{if $team['delivery']=='express'}-->
                <tr>
                    <td class="deal-buy-desc">express</td>
                    <td class="deal-buy-quantity"></td>
                    <td class="deal-buy-multi"></td>
                    <td class="deal-buy-price"><span class="money">{$currency}</span><span id="deal-express-price" v="{$team['fare']}">{$team['fare']}</span></td>
                    <td class="deal-buy-equal">=</td>
                    <td class="deal-buy-total"><span class="money">{$currency}</span><span id="deal-express-total" v="{$team['fare']}">{$team['fare']}</span></td>
                </tr>
				<!--{/if}-->
				

				<tr class="order-total">
                    <td class="deal-buy-desc"><strong>total amount of orders value：</strong></td>
                    <td class="deal-buy-quantity"></td>
                    <td class="deal-buy-multi"></td>
                    <td class="deal-buy-price"></td>
                    <td class="deal-buy-equal">=</td>
                    <td class="deal-buy-total"><span class="money">{$currency}</span><strong id="deal-buy-total-t">{$order['origin']}</strong></td>
                </tr>
            </table>
			<!--{if $team['delivery']=='pickup'}-->				
		   <div class="field pickup">
				<label>pickup relay</label>
				<!--input type="text" size="30" name="pickup" id="settings-pickup" class="" value="{$login_user['pickup']}"  datatype="pickup" maxLength="11" /-->
				<select size="1" name="relay_id" id="relay_id" class="f-select" 
                	onchange="javascript:selCenter(this)" 
                	style="float: left;width:250px"
					value="{$login_user['pickup']}" maxLength="11"  >
					<option value=''>Select your relay</option>
					${Utility::Option($option_relays)}					 
				</select> 				
				<span class="inputtip">Please select pickup relay</span>
                
			</div>
			<div id="gmap" style="width:640px; height:320px;margin: 40px  0 0 15px;border: 1px solid #AAAAAA;"></div>
			<!--{/if}-->

			<!--{if $team['delivery']=='express'}-->
			<div class="expresstip">${nl2br(htmlspecialchars($team['express']))}</div>
			<div class="wholetip clear"><h3>express info</h3></div>
			<div class="field username">
				<label>receiver</label>
				<input type="text" size="30" name="realname" id="settings-realname" class="f-input" value="{$login_user['realname']}" require="true" datatype="realname" />
				<span class="hint">Receiver's name should be consistent with his/her ID name to make sure a successful delivery</span>
			</div>
			<div class="field mobile">
				<label>mobile number</label>
				<input type="text" size="30" name="mobile" id="settings-mobile" class="number" value="{$login_user['mobile']}" require="true" datatype="mobile" maxLength="11" /> <span class="inputtip">Your mobile is the most important way for us to contact you, please input the number correctly</span>
			</div>
				<div class="field address">
				<label>address</label>
				<input type="text" size="30" name="address" id="settings-address" class="f-input" value="{$login_user['address']}" require="true" datatype="address" />
				<span class="hint">For a timely delivery, please input your address_</span>
			</div>
			<div class="field zipcode">
				<label>zipcode</label>
				<input type="text" size="30" name="zipcode" id="settings-zipcode" class="number" value="{$login_user['zipcode']}" require="true" datatype="zip" maxLength="6" />
			</div>
			<!--{else}-->
			<div class="field mobile">
				<label>mobile number</label>
				<input type="text" size="30" name="mobile" id="settings-mobile" class="number" value="{$login_user['mobile']}"  datatype="mobile" maxLength="11" /><span class="inputtip">Please input a correct mobile number(you may buy for your friend)</span>
			</div>
			<!--{/if}-->
  
			<div class="wholetip clear"><h3>additional info</h3></div>
			<!--{if $condbuy=nanooption($team['condbuy'])}-->
			<div class="field condbuy">
				<label>order options</label>
				<select name="condbuy" class="f-input" style="width:auto;">${Utility::Option(array_combine($condbuy, $condbuy), 'condbuy')}</select>
			</div>
			<!--{/if}-->
			<div class="field remark">
				<label>order info</label>
				<textarea name="remark" style="width:480px;height:80px;padding:2px;">${htmlspecialchars($order['remark'])}</textarea>
			</div>
            <input type="hidden" name="id" value="{$order['id']}" />
			<div class="form-submit"><input type="submit" class="formbutton" name="buy" value="have confirmed，buy"/></div>
            </div>
        </div>
        <div class="box-bottom"></div>
    </div>
    </form>
</div>
<div id="sidebar">
	<!--{include block_side_credit}-->
</div>
</div> <!-- bd end -->
</div> <!-- bdw end -->

<script>
window.x_init_hook_dealbuy = function(){
	X.team.dealbuy_farefree(${abs(intval($order['quantity']))});
	X.team.dealbuy_totalprice();
};
</script>
<!--{include footer}-->
